<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    
<link rel="stylesheet" href="css/result.css" type="text/css"></link>
<link rel="stylesheet" href="css/style.css" type="text/css"></link>
    
  </head>
  
  <body>
  
    
	<div id="main" class="main-div">
		<div style="height: 90px;"></div>
		<div class="main-div">
			<div style="margin-bottom:60px">
				<h1 style="text-align: center;">图书借阅系统</h1>
			</div>
			<%-- 搜索 --%>
			<div class="search_div"
				style="margin: auto; background-color: gray; text-align: center">
				<div style="width : 1000px; margin: auto; text-align: center">
					<div class="float_left book_type">
						<label>图书分类：</label> <select>
							<option>--请选择--</option>
							<option>小说</option>
							<option>散文</option>
							<option>现代散文</option>
							<option>科技</option>
						</select>

					</div>
					<form action="bookInfo/findAllBook" method="Post">
					<div class="float_left book_name">
						<label>图书名称</label> <input type="text" name="likeName"/>
					</div>
					<div class="float_left is_borrow ">
						<label>是否借阅：</label> <select>
							<option>--请选择--</option>
							<option>未借阅</option>
							<option>已借阅</option>
						</select>
					</div>
					<div class="float_left" style=" width: 80px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
					<div class="float_left">
						<input style="width: 60px;heght:30px;margin: 5px;" type="submit"
							value="查询">
					</div>
					</form>
					<div class="clear_float"></div>
				</div>
			</div>
			<%-- userinfo --%>
			<div class="float_right" style="width: 210px;">
				<!-- 这里的bookCode是 map.put("bookCode",rs.getInt("book_code")); -->
				<div>
					当前用户： ${userIinfo.userCode} &nbsp;&nbsp;<a href="#">退出</a>&nbsp;&nbsp;
				</div>
			</div>
			<div class="clear_float"></div>
			<%-- findBookALLInfo --%>
			<div style="margin-top: 25px;">
				<div
					style="margin-bottom: 30px; background-color: green;height: 50px;">
					<ul list-style:none;>
						<li class="book_li">图书编号</li>
						<li class="book_li">图书分类</li>
						<li class="book_li">图书名称</li>
						<li class="book_li">作者</li>
						<li class="book_li">出版社</li>
						<li class="book_li">操作</li>
						<li class="clear_float"></li>
					</ul>
				</div>

				<div style="margin-bottom: 30px">

					<!-- El表达式主要用于获取后台响应给前台的数据 -->
					<%-- var="book" 定义一个变量  --%>
					<c:forEach items="${list}" var="book">
					
						<ul >
							<li class="book_li">${book.bookCode }</li>
							<li class="book_li">${book.typeName }</li>
							<li class="book_li">${book.bookName }</li>
							<li class="book_li">${book.userCode }</li>
							<li class="book_li">${book.publishPress }</li>
							<c:if test="${book.isBorrow==0}">

								<a href="updateIsBorrowAnction?id=${book.bookId}">
									<li class="book_li">申请借阅</li>
								</a>

							</c:if>
							<c:if test="${book.isBorrow==1}">

								<li class="book_li" style="color: red">已借阅</li>
							</c:if>

							<li class="clear_float"></li>
						</ul>
							
					</c:forEach>

				</div>
			</div>
		</div>
	</div>
  </body>
</html>


